﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace comm
{
    public sealed class UniqueID
    {
        string _prefix = "";
        int _count = 0;

        public UniqueID(string prefix = "")
        {
            _prefix = prefix;
        }

        public string NewId()
        {
            lock (this)
            {
                _count++;
                return _prefix + _count;
            }
        }
    }
}
